package com.youkun.controller;

import com.youkun.entity.User;
import com.youkun.services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by youkun on 2017/3/8.
 */
@RestController
@RequestMapping("/rest")
public class UserResourcesController {

    @Autowired
    private UserServices userServices;

    @RequestMapping(value = "/user/users")
    public String LoginSuccess(){

        return "Login success";
    }

    @RequestMapping("/user/userName")
    public User findUserByUserName(@RequestBody String username){

        return userServices.findByuserName(username);
    }

}
